<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <style>
        /*tbody tr td:last-child{
            display: none;
        }*/
        #table2{
            width:100%;
            /* overflow-y: scroll;
             height:90%;*/
        }
        #table2 .layui-table{
            width:100%;
        }
        #table2 .layui-table tr{
            width:100%;

        }
        .layui-table td, .layui-table th{
           /* max-width: 50px;*/
            text-align: center;
            /*box-sizing: border-box;*/
        }

        .layui-table td input, .layui-table th input{
            /* // max-width: 50px;*/
            text-align: center;
            width:100%;
        }
        /*.layui-table tr td:first-child,.layui-table tr th:first-child{
            *//*max-width: 30px;*//*
            width:30px;
        }*/

        .layui-table tr td span:last-child{
            display:none;
        }
        tbody tr .operationClick{
            display: none;
        }
    </style>
</head>

<BODY>
<center style="">
    <div style="width: 99%;height: 100%;">

        <div id="table2"></div>
        <div id="pageBar2"></div>
    </div>

</center>
</body>
<!--<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>-->
<!--<script language="Javascript" src="../jqueryNicepage/js/layui.js"></script>-->
<!--<script language="Javascript" src="../jqueryNicepage/js/singleNicePage.js"></script>-->
<script LANGUAGE="javascript">
    var check="false";
    var flage=true;
    //标准json格式 目前只支持[{a:b,c:d},{a:b,c:d}]此种格式
    var dataListObj=[];
    var json1 =window.historyList1;
    var nameList1= window.headers1 //table的列名
    var widthList1 = window.widths1//table每列的宽度

   // console.log(typeof window.selectedAll)
    $(function () {
        window.nicePage = {
            table: "div",
            bar: "bar",
            limit: "10",
            color: "#1E9FFF",
            layout: ["count", "prev", "page", "next", "limit", "skip"],
            setCfg: function(b) {
                nicePage.table = b.table;
                nicePage.bar = b.bar;
                nicePage.limit = b.limit;
                nicePage.color = b.color;
                nicePage.layout = b.layout
            },
            returnHtml: function(g, e) {
                var h = '<table class="layui-table" lay-size="sm"><colgroup>';
                for (var f in e) {
                    h += " <col width=" + e[f] + ">"
                }
                h += " </colgroup><thead><tr>";

                for (var f in g) {
                    h += "  <th>" + g[f] + "</th>"
                }
                h += " </tr></thead> <tbody>";
                return h
            },
            returnList: function(j) {
                var h = new Array();
                for (var f in j) {
                    var i = "";
                    for (var g in j[f]) {
                        i += j[f][g] + "&*"
                    }
                    i = i.substring(0, i.length-2);
                    h.push(i)
                }
                return h
            },
            returnTable: function(index,e) {
                var h = e.split("&*");
                if(window.selectedAll!=undefined&&window.selectedAll==true){
                    var g = "<tr><td class='checkedbox'><input class='checkboxS' type='checkbox'></td><td class='serialNumber'>"+index+"</td>";
                }else{
                    var g = "<tr><td class='serialNumber'>"+index+"</td>";
                }
               
                for (var f in h) {
                    if(h[f].split("{}").length>1){
                        var newArr=[];
                        for(var k=0;k<h[f].split("{}").length;k++){
                            if(h[f].split("{}")[k]!=""){
                                newArr.push(h[f].split("{}")[k])
                            }
                        }
                        g += "<td class='td"+f+"'>";
                        for(var m=0;m<newArr.length;m++){
                            var sty="",
                            classNames="";
                            if(h[f].split("{}")[m].split("|")[1]==""){
                                sty="style='color:#ccc;'"
                                classNames="class='noCursor'"
                            }
                            if(newArr.length==1||m==(newArr.length-1)){
                                g +="<a title='"+h[f].split("{}")[m].split("|")[0]+"'  "+sty+" "+classNames+" data-num='"+h[f].split("{}")[m].split("|")[1]+"'>"+h[f].split("{}")[m].split("|")[0]+"</a>";
                            }else{
                                g +="<a title='"+h[f].split("{}")[m].split("|")[0]+"'  "+sty+" "+classNames+" data-num='"+h[f].split("{}")[m].split("|")[1]+"'>"+h[f].split("{}")[m].split("|")[0]+"</a><span>|</span>";
                            }

                        }

                        g+="</td>";
                    }else{
                        if(getIndexof(h[f],"<a")>-1){
                            var titleText=h[f].split(">")[1].split("</a")[0];
                        }else{
                            var titleText=h[f];
                        }
                        g += "<td title='"+titleText+"' class='td"+f+"'>"+h[f]+"</td>";
                    }

                }
              //  g += "<td class='operationClick' data-checked=true><i title='查看' class='iconfont'>&#xe64c;</i></td></tr>";
                g+="</tr>"
                return g
            }
        };
        nicePage.setCfg({
            cont: $('#pageBar2,#pageBar'),
            table: 'table2',
            bar: 'pageBar2',
            limit: 30,
            color: '#1E9FFF',
            layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
        });

        layui.use("laypage", function() {
            var a = layui.laypage;
            var table = layui.table;
            a.render({
                elem: nicePage.bar,
                limit: nicePage.limt,
                theme: nicePage.color,
                count: json1.length,
                layout: nicePage.layout,
                jump: function(w) {
                    document.getElementById(nicePage.table).innerHTML = function() {
                        var c = [nicePage.returnHtml(nameList1, widthList1)],
                                d = nicePage.returnList(json1).concat().splice(w.curr * w.limit - w.limit, w.limit);
                        layui.each(d, function(index, g) {
                            var f = nicePage.returnTable(index+1,g);
                            c.push(f)
                        });
                        c.push(" </tbody></table></br>");
                        return c.join("")
                    }()
                }
            })

        })
    });
    window.onload=function(){
        $("tbody tr .operationClick").remove();
    }

</script>

</html>